package usb;
import java.util.Scanner;

public class Test09 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String name = "ch";
        String pwd = "123";
        int i =0;
        for(i=2;i>=0;i--){
            System.out.println("请输入用户名：");
            String user = sc.nextLine();
            System.out.println("请输入密码：");
            String password = sc.nextLine();
            if(name.equals(user) &&  pwd.equals(password)){
                System.out.println("欢迎登录MyShopping系统！");
                break;
            }else {
                if(i==0){
                    System.out.println("对不起，您三次均输入错误！");
                }else {
                    System.out.println("输入错误!您还有"+i+"次机会!");
                }
            }
        }
    }
}
